<template>
<div>
  <table>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
    </tr>
    <tr v-for="item in books">
      <td>{{item.id}}</td>
      <td>{{item.name}}</td>
      <td>{{item.author}}</td>

    </tr>
  </table>
</div>
</template>

<script>
export default {
name: "Book",
data() {
  return {
    books:[
      {
        id:1,
        name:'Java零基础',
        author: '宁楠'
      },
    ]
  }
},
  created() {
  const _this = this
    axios.get('http://localhost:8181/book/findAll').then(function (resp){
      _this.books = resp.data
    })
  }
}
</script>

<style scoped>

</style>